import { useState, useEffect } from 'react'
import JcyjApi from '../../../../../../../utils/apis/JcyjApi';
import { Table } from 'antd';

export default function LastWarning(props) {
    const { yhlb } = props;
    const [datas, setDatas] = useState();
    useEffect(() => {
        if (yhlb) {
            JcyjApi.warningList(yhlb, 1, 5).then(resp => {
                setDatas(resp.rows);
            }).finally(e => {
                // setLoading(false);
            })
        }
    }, [yhlb])
    return <div className='layout-h center area-stat' style={{
        flexWrap: 'wrap',
        justifyContent: "space-around",
        padding: 12,
        gap: 12
    }}>
        <Table scroll={{y:120}}  pagination={false} size={"small"} columns={[{
            dataIndex: 'yjbt',
            ellipsis: true
        }, {
            dataIndex: 'sj',
            ellipsis: true
        }]} showHeader={false}
            dataSource={datas}
            rowKey={'id'}
        ></Table>
    </div>;
}